<?php
$data = $this->data;
/*
echo '<pre>';
print_r($data);
echo '</pre>';
*/
?>
<ul class="carousel">
    <?php
    foreach ($data as $message){
        $class = '';
        $is_me = '';
        $info = Velacolib\Utility\Utility::GetUserInfo($message['form_user'],"Admin\Model\AdminUserTable");
        if($message['form_user'] == $this->user_id){
            $class = 'my_message';
            $is_me = ' ( Me ) ';
        }

    ?>
    <li class="testimonial">
        <div class="testimonials message_item  <?php echo $class; ?>">
            <div class="message_author">
                <div class="avatar">
                    <img src="<?php echo $info->avatar; ?>">
                </div>
                <div class="info">
                    <h5><?php        //print_r($info);
                    echo $info->name.$is_me;
                    ?>
                    </h5>
                    <span><?php echo $message['create_date']; ?></span>
                </div>
            </div>
            <div class="message_content">
                <?php echo $message['message_content']; ?>
            </div>
        </div>

    </li>
<?php
}?>
</ul>

